#ifndef LHC_EXCEPTIONS_H_INCLUDED_
#define LHC_EXCEPTIONS_H_INCLUDED_

#include "UnicodeString.h"
#include "Macros.h"
#include <stdexcept>

namespace lhcutils
{

class Exception : public std::exception
{
private:
	lhcutils::StringPtr m_message;
	boost::shared_ptr<const CountedArray<uint8_t> > m_utf8Message;

public:
	Exception(lhcutils::StringPtr message);
	virtual ~Exception();

protected:
	lhcutils::StringPtr GetMessage() const;
public:
	virtual const char* what() const OVERRIDE;
	virtual lhcutils::StringPtr UnicodeWhat() const;
};


class CommandLineOptionException : public Exception
{
public:
	CommandLineOptionException(StringPtr message);
	virtual ~CommandLineOptionException();
};


class NotSupportedException : public lhcutils::Exception
{
public:
	NotSupportedException(lhcutils::StringPtr message);
	virtual ~NotSupportedException();
};


class ProgrammerErrorException : public lhcutils::Exception
{
public:
	ProgrammerErrorException(lhcutils::StringPtr message);
	virtual ~ProgrammerErrorException();
};


class IoException : public lhcutils::Exception
{
public:
	IoException(StringPtr message);
	virtual ~IoException();
};


class AccessDeniedException : public IoException
{
public:
	AccessDeniedException(StringPtr message);
	virtual ~AccessDeniedException();
};


class EndOfFileException : public IoException
{
public:
	EndOfFileException(StringPtr message);
	virtual ~EndOfFileException();
};


class FileNotFoundException : public IoException
{
public:
	FileNotFoundException(StringPtr message);
	virtual ~FileNotFoundException();

};

}

#endif

/*
 Copyright 2011 Greg Najda

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
